<template>
	<view class="warp">
		<view class="receiving_address">
			<u-icon name="quyushouquan" customPrefix="coolc" color="#ffa911" size="66"></u-icon>
			<view class="address_info">
				<view class="user_info">
					<view class="name">张大骞</view>
					<view class="mobile">19970861797</view>
				</view>
				<view class="address">地址：深圳市南山区前海湾香江大院169号</view>
			</view>
		</view>
		<view class="no_address" @click="addaddress" v-if="!address">
			<u-icon name="bianji" customPrefix="coolc" size="30"></u-icon>
			<view class="text">添加收货地址</view>
		</view>
		<view class="no_address" @click="chgaddress" v-if="address">
			<u-icon name="bianji" customPrefix="coolc" size="30"></u-icon>
			<view class="text">选择收货地址</view>
		</view>
		<view class="cart_goods">
			<view class="item">
				<view class="card">
					<image src="~@/static/jitai/pic/IMG_7060.png"></image>
					<view class="infos">
						<view class="name">负氧离子车用套盒</view>
						<view class="span">一次尽享  清新舒畅</view>
						<view class="price">￥2980.00</view>
					</view>
				</view>
				<view class="text_box">
					<view class="text">优惠活动</view>
					<view class="message">
						立减1000元
						<u-icon name="jiantouright" customPrefix="coolc" size="26"></u-icon>
					</view>
				</view>
				<view class="text_box">
					<view class="text">配送费用</view>
					<view class="message">
						0元
						<u-icon name="jiantouright" customPrefix="coolc" size="26"></u-icon>
					</view>
				</view>
			</view>
		</view>
		
		<view class="balance_pay_box">
			<view class="title">余额支付</view>
			<view class="xz">
				<view class="jr">￥1986300.36</view>
				<u-switch v-model="switchD" size="40" activeColor="#35c877" @change="SwitchD" ></u-switch>
			</view>
		</view>
		
		<view class="pay_type_box">
			<view class="title">支付方式</view>
			<u-radio-group class="pay_item" active-color="#ffa911" v-model="pay" @change="radioGroupChange">
				<view class="item">
					<image src="~@/static/jitai/payimg/weixin.png"></image>
					<u-radio name="1"></u-radio>
				</view>
				<view class="item">
					<image src="~@/static/jitai/payimg/alipay.png"></image>
					<u-radio name="2"></u-radio>
				</view>
				<view class="item">
					<image src="~@/static/jitai/payimg/offline.png"></image>
					<u-radio name="3"></u-radio>
				</view>
			</u-radio-group>
		</view>
		<u-gap height="100" bg-color="#f1f1f1"></u-gap>
		
		<view class="cont_pay">
			<view class="num">实付款：<text>￥12980.00</text></view>
			<view class="btnalls">立即支付</view>
		</view>
	</view>
</template>

<script>
	export default {
		data() {
			return {
				address: '',
				pay: '',
				switchD: false
			}
		},
		methods: {
			addaddress(){
				uni.navigateTo({
					url:'/pages/user/address_edit'
				});
			},
			chgaddress(){
				uni.navigateTo({
					url:'/pages/user/address?select=1'
				});
			},
			SwitchD(value) {
				this.switchD = value;
			},
			radioGroupChange(value) {
				// console.log(e);
			}
		}
	}
</script>

<style lang="scss">
	page {
		background: #f1f1f1;
	}
	.warp {
		padding: 28rpx;
	}
	.cont_pay {
		width: 100%;
		padding: 18rpx 28rpx;
		background: #fff;
		box-shadow: 0 0 14rpx #ccc;
		position: fixed;
		display: flex;
		justify-content: space-between;
		align-items: center;
		margin: 0rpx!important;
		left: 0rpx;
		right: 0rpx;
		bottom: 0rpx;
		
		.num {
			color: #666666;
			
			text {
				font-size: 38rpx;
				font-weight: bold;
				color: #ffa911;
			}
		}
		.btnalls {
			width: 200rpx;
			padding: 20rpx 0;
			text-align: center;
			border-radius: 50rpx;
			background: #ffa911;
			color: #fff;
			font-size: 30rpx;
		}
	}
	.list_goods {
		margin-top: 20rpx;
	}
	.no_address {
		width: 100%;
		height: 80rpx;
		font-size: 28rpx;
		border-radius: 20rpx;
		display: flex;
		justify-content: center;
		align-items: center;
		border: 2rpx solid #35c877;
		background: #ffffff;
		color: #35c877;
		margin-top: 20rpx;
		
		.u-icon {
			margin-right: 10rpx;
		}
	}
	.pay_type_box {
		background: #fff;
		padding: 20rpx 20rpx 0 20rpx;
		border-radius: 20rpx;
		margin-bottom: 20rpx;
		
		.title {
			width: 100%;
			height: 56rpx;
		}
		
		.pay_item {
			width: 100%;
			
			.item {
				width: 100%;
				padding: 25rpx 0;
				display: flex;
				justify-content: space-between;
				align-items: center;
				border-top: 2rpx solid #eee;
				
				&:nth-child(1) {
					border-top: 0rpx;
					padding-top: 0rpx;
				}
				
				image {
					width: 204rpx;
					height: 71rpx;
				}
			}
		}
	}
	.balance_pay_box {
		background: #fff;
		padding: 20rpx;
		border-radius: 20rpx;
		margin-bottom: 20rpx;
		
		.title {
			width: 100%;
			height: 56rpx;
		}
		.xz {
			width: 100%;
			display: flex;
			justify-content: space-between;
			align-items: center;
			
			.jr {
				font-size: 34rpx;
				font-weight: bold;
				color: #ffa911;
			}
		}
	}
	.cart_goods {
		width: 100%;
		margin-top: 20rpx;
		
		.item {
			background: #fff;
			padding: 20rpx 20rpx 0 20rpx;
			border-radius: 20rpx;
			margin-bottom: 20rpx;
			
			.text_box {
				height: 90rpx;
				display: flex;
				justify-content: space-between;
				align-items: center;
				border-top: 2rpx solid #f1f1f1;
				
				.text {
					color: #666666;
				}
				.message {
					color: #ff0000;
					
					.u-icon {
						margin-left: 10rpx;
						color: #999999;
					}
				}
			}
			.card {
				display: flex;
				align-items: center;
				padding-bottom: 20rpx;
				
				image {
					width: 192rpx;
					height: 192rpx;
					border-radius: 16rpx;
				}
				
				.infos {
					padding-left: 20rpx;
					
					.name {
						width: 100%;
						font-size: 28rpx;
						color: #666;
						padding: 4rpx 0 10rpx 0;
					}
					.span {
						font-size: 24rpx;
						color: #999;
					}
					.price {
						padding-top: 30rpx;
						font-size: 30rpx;
						font-weight: bold;
						color: #ffa911;
					}
				}
			}
		}
	}
	.receiving_address {
		width: 100%;
		background: #fff;
		padding: 28rpx 20rpx;
		border-radius: 20rpx;
		display: flex;
		justify-content: space-between;
		
		.address_info {
			width: 585rpx;
			padding-left: 16rpx;
			
			.user_info {
				display: flex;
				justify-content: space-between;
				padding-bottom: 10rpx;
				
				.name {
					font-size: 32rpx;
					color: #000;
				}
				.mobile {
					font-size: 32rpx;
					color: #000;
				}
			}
			.address {
				font-size: 26rpx;
				color: #666666;
			}
		}
	}
</style>
